<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/warehouse/warehouse/Ware_ReplenishmentMaterial.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/warehouse/warehouse/Ware_ReplenishmentMaterial.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ReplenishmentID',
                footer: "Foots",
                cnName: '补料单',
                name: 'warehouse/Ware_ReplenishmentMaterial',
                url: "/Ware_ReplenishmentMaterial/",
                sortName: "ReplenishmentID"
            });
            const editFormFields = ref({"ReplenishmentProductCode":"","ProductCode":"","ProductName":"","ProductStandard":"","ReplenishmentMan":"","ReplenishmentQnty":"","Remark":""});
            const editFormOptions = ref([[{"dataKey":"reworkOrderCode","data":[],"title":"补料工单","field":"ReplenishmentProductCode","type":"select"},
                               {"dataKey":"productCode","data":[],"title":"产品编码","required":true,"field":"ProductCode","type":"select"}],
                              [{"title":"产品名称","required":true,"field":"ProductName","disabled":true,"type":"text"},
                               {"title":"产品规格","field":"ProductStandard","disabled":true,"type":"text"}],
                              [{"title":"补料人","required":true,"field":"ReplenishmentMan","type":"text"},
                               {"title":"补料数量","required":true,"field":"ReplenishmentQnty","type":"number"}],
                              [{"title":"备注","field":"Remark","type":"textarea"}]]);
            const searchFormFields = ref({"ReplenishmentCode":"","ReplenishmentProductCode":"","ProductCode":"","ProductName":"","ReplenishmentMan":""});
            const searchFormOptions = ref([[{"title":"补料单号","field":"ReplenishmentCode","type":"text"},{"dataKey":"reworkOrderCode","data":[],"title":"补料工单","field":"ReplenishmentProductCode","type":"text"}],[{"dataKey":"productCode","data":[],"title":"产品编码","field":"ProductCode","type":"text"},{"title":"产品名称","field":"ProductName","type":"text"}],[{"title":"补料人","field":"ReplenishmentMan","type":"text"}]]);
            const columns = ref([{field:'ReplenishmentID',title:'补料单ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ReplenishmentCode',title:'补料单号',type:'string ',width:110,hidden:true,require:true,align:'left'},
                       {field:'ReplenishmentProductCode',title:'补料工单',type:'string ',bind:{ key:'reworkOrderCode',data:[]},width:200,align:'left',sort:true},
                       {field:'ProductCode',title:'产品编码',type:'string',bind:{ key:'productCode',data:[]},width:220,require:true,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',width:220,readonly:true,require:true,align:'left'},
                       {field:'ProductStandard',title:'产品规格',type:'string',width:180,readonly:true,align:'left'},
                       {field:'ReplenishmentMan',title:'补料人',type:'string',width:220,require:true,align:'left'},
                       {field:'ReplenishmentQnty',title:'补料数量',type:'int',width:110,require:true,align:'left'},
                       {field:'BState',title:'状态',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'CreateDate',title:'新增时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'CreateID',title:'新增人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'新增人名称',type:'string',width:130,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人名称',type:'string',width:130,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:110,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人ID',type:'int',width:80,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
